public class chu3chu5 {
    public static void main(String[] args) {
        int[] arr1 = new int[50];
        int[] arr2 = new int[50];
        int[] arr3 = new int[50];
        int x1 = 0;
        int x2 = 0;
        int x3 = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 3 == 0 && i % 5 != 0) {
                arr1[x1] = i;
                x1++;
            } else if (i % 5 == 0 && i % 3 != 0) {
                arr2[x2] = i;
                x2++;
            } else if (i % 5 == 0 && i % 3 == 0) {
                arr3[x3] = i;
                x3++;
            }
        }
        System.out.println("Flip:");
        for (int i = 0; i < x1; i++) {
            System.out.print(arr1[i] + " ");
        }
        System.out.println();
        System.out.println("Flop:");
        for (int i = 0; i < x2; i++) {
            System.out.print(arr2[i] + " ");
        }
        System.out.println();
        System.out.println("FlipFlop:");
        for (int i = 0; i < x3; i++) {
            System.out.print(arr3[i] + " ");
        }
    }
}/*
        public static void main(String[] args) {
            int [] list1 = new int[50];
            int [] list2 = new int[50];
            int [] list3 = new int[50];
            int x1 = 0;
            int x2 = 0;
            int x3 = 0;

            for(int i=1;i<=100;i++) {
                if(i%3==0&&i%5!=0) {
                    list1[x1] = i;
                    x1++;
                }
                else if(i%5==0&&i%3!=0) {
                    list2[x2] = i;
                    x2++;
                }
                else if(i%5==0&&i%3==0) {
                    list3[x3] = i;
                    x3++;
                }
            }
            System.out.println("“Flip”的元素为：");
            for (int i = 0; i < x1; i++) {
                System.out.print(list1[i]+", ");
            }
            System.out.println();
            System.out.println("“Flop”的元素为：");
            for (int i = 0; i < x2; i++) {
                System.out.print(list2[i]+", ");
            }
            System.out.println();
            System.out.println("“FlipFlop”的元素为：");
            for (int i = 0; i < x3; i++) {
                System.out.print(list3[i]+", ");
            }
        }*/
